package com.example.coursehub.coursemanagement.service;

import com.example.coursehub.coursemanagement.entity.Course;
import com.example.coursehub.coursemanagement.entity.Chapter;
import com.example.coursehub.coursemanagement.entity.Material;

import java.util.List;
import java.util.Optional;

/**
 * 课程管理服务接口
 */
public interface CourseService {
    
    // 课程相关操作
    Course createCourse(Course course);
    Course updateCourse(Long id, Course course);
    void deleteCourse(Long id);
    Optional<Course> getCourseById(Long id);
    List<Course> getAllCourses();
    List<Course> getCoursesByTeacher(Long teacherId);
    List<Course> searchCoursesByName(String name);
    
    // 章节相关操作
    Chapter createChapter(Chapter chapter);
    Chapter updateChapter(Long id, Chapter chapter);
    void deleteChapter(Long id);
    Optional<Chapter> getChapterById(Long id);
    List<Chapter> getChaptersByCourse(Long courseId);
    
    // 资料相关操作
    Material createMaterial(Material material);
    Material updateMaterial(Long id, Material material);
    void deleteMaterial(Long id);
    Optional<Material> getMaterialById(Long id);
    List<Material> getMaterialsByCourse(Long courseId);
    List<Material> getMaterialsByChapter(Long chapterId);
}